{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "添加ResidualUsefulLifeRatio(RULR)列，注意train_03_plc只有37份"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import joblib\n",
    "import datetime as dt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_01_plc = joblib.load('./train_plc/train_01_plc.lz4')\n",
    "train_02_plc = joblib.load('./train_plc/train_02_plc.lz4')\n",
    "train_03_plc = joblib.load('./train_plc/train_03_plc.lz4')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def CalRULR(offset,start,cur,total_life):\n",
    "    '''\n",
    "    描述：\n",
    "        offset表示第几段(从1开始计算),其余输入为TimeStamp，输出单位是min.数据是5分钟中的最后一分钟\n",
    "        \n",
    "    '''\n",
    "    cost = (offset*5-1) + (cur-start).value/(1e9*60) #min\n",
    "    rulr = 1 - cost/total_life\n",
    "    return rulr\n",
    "\n",
    "def CalCostLife(offset,start,cur,base_cost):\n",
    "    '''\n",
    "    描述：\n",
    "        计算已经花费的有效时间(CL)\n",
    "    '''\n",
    "    cost = (offset*5-1) + (cur-start).value/(1e9*60) #min\n",
    "    cost_life = base_cost + cost\n",
    "    return cost_life\n",
    "\n",
    "def CalCostLifeInterval(offset,base_cost):\n",
    "    '''\n",
    "    描述：\n",
    "        计算已经花费的有效时间区间(CLI, Cost Life Interval)\n",
    "    '''\n",
    "    cost_interval = offset*5\n",
    "    cost_life_interval = base_cost + cost_interval\n",
    "    return cost_life_interval\n",
    "\n",
    "def TransTime(data_plc, csv_nos=48, base_cost=0, total_time =240):\n",
    "    '''\n",
    "    描述：\n",
    "        把plc文件中的时间转化为剩余有用寿命比例RULR\n",
    "    参数：\n",
    "        data_plc：\n",
    "        csv_nos：plc对应的sensor文件数量\n",
    "        total_time:寿命\n",
    "    '''\n",
    "    data_plc = data_plc.loc[data_plc['csv_no']<=csv_nos]\n",
    "    rulr = []\n",
    "    cl = []\n",
    "    cli = []\n",
    "    for i in range(1,csv_nos+1):\n",
    "        time_seg = data_plc.loc[data_plc['csv_no']==i, 'time']\n",
    "        start = time_seg.min()\n",
    "        rulr.append(time_seg.apply(lambda x:CalRULR(i, start, x, total_time)).values)\n",
    "        cl.append(time_seg.apply(lambda x:CalCostLife(i, start, x, base_cost)).values)\n",
    "        cli.append(time_seg.apply(lambda x:CalCostLifeInterval(i, base_cost)).values)\n",
    "        \n",
    "    rulr_arr = np.hstack(rulr)\n",
    "    cl_arr = np.hstack(cl)\n",
    "    cli_arr = np.hstack(cli)\n",
    "    \n",
    "    result = data_plc.drop(columns=['time'])\n",
    "    result['RULR'] = rulr_arr\n",
    "    result['CL'] = cl_arr\n",
    "    result['CLI'] = cli_arr\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_01 = TransTime(train_01_plc, 48, 0, 240)\n",
    "data_02 = TransTime(train_02_plc, 48, 0, 240)\n",
    "data_03 = TransTime(train_03_plc, 37, 0, 185)  # train_03_plc只有37份"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['./train_plc_RULR/train_03_plc.lz4']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "if not os.path.exists('train_plc_RULR'):\n",
    "    os.mkdir('train_plc_RULR')\n",
    "output_dir = './train_plc_RULR'\n",
    "joblib.dump(data_01,os.path.join(output_dir,'train_01_plc.lz4'))\n",
    "joblib.dump(data_02,os.path.join(output_dir,'train_02_plc.lz4'))\n",
    "joblib.dump(data_03,os.path.join(output_dir,'train_03_plc.lz4'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>spindle_load</th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "      <th>z</th>\n",
       "      <th>csv_no</th>\n",
       "      <th>RULR</th>\n",
       "      <th>CL</th>\n",
       "      <th>CLI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978378</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978377</td>\n",
       "      <td>4.000167</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978377</td>\n",
       "      <td>4.000333</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978376</td>\n",
       "      <td>4.000500</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978375</td>\n",
       "      <td>4.000667</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978374</td>\n",
       "      <td>4.000833</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978371</td>\n",
       "      <td>4.001333</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978370</td>\n",
       "      <td>4.001500</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978334</td>\n",
       "      <td>4.008267</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978357</td>\n",
       "      <td>4.003933</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978348</td>\n",
       "      <td>4.005600</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978339</td>\n",
       "      <td>4.007267</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978330</td>\n",
       "      <td>4.008933</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978321</td>\n",
       "      <td>4.010600</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978312</td>\n",
       "      <td>4.012267</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978303</td>\n",
       "      <td>4.013933</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978294</td>\n",
       "      <td>4.015600</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978285</td>\n",
       "      <td>4.017267</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978360</td>\n",
       "      <td>4.003333</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978359</td>\n",
       "      <td>4.003500</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978359</td>\n",
       "      <td>4.003667</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978358</td>\n",
       "      <td>4.003833</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978357</td>\n",
       "      <td>4.004000</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978356</td>\n",
       "      <td>4.004167</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978355</td>\n",
       "      <td>4.004333</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978354</td>\n",
       "      <td>4.004500</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978353</td>\n",
       "      <td>4.004667</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978352</td>\n",
       "      <td>4.004833</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978351</td>\n",
       "      <td>4.005000</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>0.045778</td>\n",
       "      <td>-300.9473</td>\n",
       "      <td>127.3867</td>\n",
       "      <td>-277.0397</td>\n",
       "      <td>1</td>\n",
       "      <td>0.978350</td>\n",
       "      <td>4.005167</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85263</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000068</td>\n",
       "      <td>184.987333</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85264</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000068</td>\n",
       "      <td>184.987500</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85265</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000067</td>\n",
       "      <td>184.987667</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85266</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000066</td>\n",
       "      <td>184.987833</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85267</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000065</td>\n",
       "      <td>184.988000</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85268</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000064</td>\n",
       "      <td>184.988167</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85269</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000063</td>\n",
       "      <td>184.988333</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85270</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000062</td>\n",
       "      <td>184.988500</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85271</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000061</td>\n",
       "      <td>184.988667</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85272</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000060</td>\n",
       "      <td>184.988833</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85273</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000059</td>\n",
       "      <td>184.989000</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85274</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-405.2603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000059</td>\n",
       "      <td>184.989167</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85275</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-354.0603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000045</td>\n",
       "      <td>184.991667</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85276</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-354.0603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000044</td>\n",
       "      <td>184.991833</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85277</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-354.0603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000043</td>\n",
       "      <td>184.992000</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85278</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-354.0603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000042</td>\n",
       "      <td>184.992167</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85279</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-354.0603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000041</td>\n",
       "      <td>184.992333</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85280</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-354.0603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000041</td>\n",
       "      <td>184.992500</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85281</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-354.0603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000040</td>\n",
       "      <td>184.992667</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85282</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-354.0603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000039</td>\n",
       "      <td>184.992833</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85283</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-354.0603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000038</td>\n",
       "      <td>184.993000</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85284</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-354.0603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000037</td>\n",
       "      <td>184.993167</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85285</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-304.4603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000023</td>\n",
       "      <td>184.995667</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85286</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-304.4603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000023</td>\n",
       "      <td>184.995833</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85287</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-304.4603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000022</td>\n",
       "      <td>184.996000</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85288</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-304.4603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000021</td>\n",
       "      <td>184.996167</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85289</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-304.4603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000020</td>\n",
       "      <td>184.996333</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85290</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-304.4603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000019</td>\n",
       "      <td>184.996500</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85291</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-304.4603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000018</td>\n",
       "      <td>184.996667</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85292</th>\n",
       "      <td>0.006104</td>\n",
       "      <td>-481.3045</td>\n",
       "      <td>-88.3909</td>\n",
       "      <td>-304.4603</td>\n",
       "      <td>37</td>\n",
       "      <td>0.000017</td>\n",
       "      <td>184.996833</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>85293 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       spindle_load         x         y         z  csv_no      RULR  \\\n",
       "0          0.045778 -300.9473  127.3867 -277.0397       1  0.978378   \n",
       "1          0.045778 -300.9473  127.3867 -277.0397       1  0.978377   \n",
       "2          0.045778 -300.9473  127.3867 -277.0397       1  0.978377   \n",
       "3          0.045778 -300.9473  127.3867 -277.0397       1  0.978376   \n",
       "4          0.045778 -300.9473  127.3867 -277.0397       1  0.978375   \n",
       "5          0.045778 -300.9473  127.3867 -277.0397       1  0.978374   \n",
       "6          0.045778 -300.9473  127.3867 -277.0397       1  0.978371   \n",
       "7          0.045778 -300.9473  127.3867 -277.0397       1  0.978370   \n",
       "8          0.045778 -300.9473  127.3867 -277.0397       1  0.978334   \n",
       "9          0.045778 -300.9473  127.3867 -277.0397       1  0.978357   \n",
       "10         0.045778 -300.9473  127.3867 -277.0397       1  0.978348   \n",
       "11         0.045778 -300.9473  127.3867 -277.0397       1  0.978339   \n",
       "12         0.045778 -300.9473  127.3867 -277.0397       1  0.978330   \n",
       "13         0.045778 -300.9473  127.3867 -277.0397       1  0.978321   \n",
       "14         0.045778 -300.9473  127.3867 -277.0397       1  0.978312   \n",
       "15         0.045778 -300.9473  127.3867 -277.0397       1  0.978303   \n",
       "16         0.045778 -300.9473  127.3867 -277.0397       1  0.978294   \n",
       "17         0.045778 -300.9473  127.3867 -277.0397       1  0.978285   \n",
       "18         0.045778 -300.9473  127.3867 -277.0397       1  0.978360   \n",
       "19         0.045778 -300.9473  127.3867 -277.0397       1  0.978359   \n",
       "20         0.045778 -300.9473  127.3867 -277.0397       1  0.978359   \n",
       "21         0.045778 -300.9473  127.3867 -277.0397       1  0.978358   \n",
       "22         0.045778 -300.9473  127.3867 -277.0397       1  0.978357   \n",
       "23         0.045778 -300.9473  127.3867 -277.0397       1  0.978356   \n",
       "24         0.045778 -300.9473  127.3867 -277.0397       1  0.978355   \n",
       "25         0.045778 -300.9473  127.3867 -277.0397       1  0.978354   \n",
       "26         0.045778 -300.9473  127.3867 -277.0397       1  0.978353   \n",
       "27         0.045778 -300.9473  127.3867 -277.0397       1  0.978352   \n",
       "28         0.045778 -300.9473  127.3867 -277.0397       1  0.978351   \n",
       "29         0.045778 -300.9473  127.3867 -277.0397       1  0.978350   \n",
       "...             ...       ...       ...       ...     ...       ...   \n",
       "85263      0.006104 -481.3045  -88.3909 -405.2603      37  0.000068   \n",
       "85264      0.006104 -481.3045  -88.3909 -405.2603      37  0.000068   \n",
       "85265      0.006104 -481.3045  -88.3909 -405.2603      37  0.000067   \n",
       "85266      0.006104 -481.3045  -88.3909 -405.2603      37  0.000066   \n",
       "85267      0.006104 -481.3045  -88.3909 -405.2603      37  0.000065   \n",
       "85268      0.006104 -481.3045  -88.3909 -405.2603      37  0.000064   \n",
       "85269      0.006104 -481.3045  -88.3909 -405.2603      37  0.000063   \n",
       "85270      0.006104 -481.3045  -88.3909 -405.2603      37  0.000062   \n",
       "85271      0.006104 -481.3045  -88.3909 -405.2603      37  0.000061   \n",
       "85272      0.006104 -481.3045  -88.3909 -405.2603      37  0.000060   \n",
       "85273      0.006104 -481.3045  -88.3909 -405.2603      37  0.000059   \n",
       "85274      0.006104 -481.3045  -88.3909 -405.2603      37  0.000059   \n",
       "85275      0.006104 -481.3045  -88.3909 -354.0603      37  0.000045   \n",
       "85276      0.006104 -481.3045  -88.3909 -354.0603      37  0.000044   \n",
       "85277      0.006104 -481.3045  -88.3909 -354.0603      37  0.000043   \n",
       "85278      0.006104 -481.3045  -88.3909 -354.0603      37  0.000042   \n",
       "85279      0.006104 -481.3045  -88.3909 -354.0603      37  0.000041   \n",
       "85280      0.006104 -481.3045  -88.3909 -354.0603      37  0.000041   \n",
       "85281      0.006104 -481.3045  -88.3909 -354.0603      37  0.000040   \n",
       "85282      0.006104 -481.3045  -88.3909 -354.0603      37  0.000039   \n",
       "85283      0.006104 -481.3045  -88.3909 -354.0603      37  0.000038   \n",
       "85284      0.006104 -481.3045  -88.3909 -354.0603      37  0.000037   \n",
       "85285      0.006104 -481.3045  -88.3909 -304.4603      37  0.000023   \n",
       "85286      0.006104 -481.3045  -88.3909 -304.4603      37  0.000023   \n",
       "85287      0.006104 -481.3045  -88.3909 -304.4603      37  0.000022   \n",
       "85288      0.006104 -481.3045  -88.3909 -304.4603      37  0.000021   \n",
       "85289      0.006104 -481.3045  -88.3909 -304.4603      37  0.000020   \n",
       "85290      0.006104 -481.3045  -88.3909 -304.4603      37  0.000019   \n",
       "85291      0.006104 -481.3045  -88.3909 -304.4603      37  0.000018   \n",
       "85292      0.006104 -481.3045  -88.3909 -304.4603      37  0.000017   \n",
       "\n",
       "               CL  CLI  \n",
       "0        4.000000    5  \n",
       "1        4.000167    5  \n",
       "2        4.000333    5  \n",
       "3        4.000500    5  \n",
       "4        4.000667    5  \n",
       "5        4.000833    5  \n",
       "6        4.001333    5  \n",
       "7        4.001500    5  \n",
       "8        4.008267    5  \n",
       "9        4.003933    5  \n",
       "10       4.005600    5  \n",
       "11       4.007267    5  \n",
       "12       4.008933    5  \n",
       "13       4.010600    5  \n",
       "14       4.012267    5  \n",
       "15       4.013933    5  \n",
       "16       4.015600    5  \n",
       "17       4.017267    5  \n",
       "18       4.003333    5  \n",
       "19       4.003500    5  \n",
       "20       4.003667    5  \n",
       "21       4.003833    5  \n",
       "22       4.004000    5  \n",
       "23       4.004167    5  \n",
       "24       4.004333    5  \n",
       "25       4.004500    5  \n",
       "26       4.004667    5  \n",
       "27       4.004833    5  \n",
       "28       4.005000    5  \n",
       "29       4.005167    5  \n",
       "...           ...  ...  \n",
       "85263  184.987333  185  \n",
       "85264  184.987500  185  \n",
       "85265  184.987667  185  \n",
       "85266  184.987833  185  \n",
       "85267  184.988000  185  \n",
       "85268  184.988167  185  \n",
       "85269  184.988333  185  \n",
       "85270  184.988500  185  \n",
       "85271  184.988667  185  \n",
       "85272  184.988833  185  \n",
       "85273  184.989000  185  \n",
       "85274  184.989167  185  \n",
       "85275  184.991667  185  \n",
       "85276  184.991833  185  \n",
       "85277  184.992000  185  \n",
       "85278  184.992167  185  \n",
       "85279  184.992333  185  \n",
       "85280  184.992500  185  \n",
       "85281  184.992667  185  \n",
       "85282  184.992833  185  \n",
       "85283  184.993000  185  \n",
       "85284  184.993167  185  \n",
       "85285  184.995667  185  \n",
       "85286  184.995833  185  \n",
       "85287  184.996000  185  \n",
       "85288  184.996167  185  \n",
       "85289  184.996333  185  \n",
       "85290  184.996500  185  \n",
       "85291  184.996667  185  \n",
       "85292  184.996833  185  \n",
       "\n",
       "[85293 rows x 8 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_03"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
